<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>create shippingOrder</title>
   <link rel="stylesheet" href="../../static/css/common.css">
    <link rel="stylesheet" href="../../static/css/form.css">
    <link rel="stylesheet" href="../../static/css/order.css">
    <link rel="stylesheet" href="../../static/css/index.css">
    <link rel="stylesheet" type="text/css" href="../../static/layui/css/layui.css"/>
    <script type="text/javascript" src="../../static/layui/layui.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/html5shiv@3.7.3/dist/html5shiv.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/respond.js@1.4.2/dest/respond.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/jquery@1.12.4/dist/jquery.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/js/bootstrap.min.js"></script>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/css/bootstrap.min.css" rel="stylesheet">
</head>
<body >
<!-- 菜单栏 -->
<link rel="stylesheet" href="../../static/css/index.css">
<ul>
    <div th:each="item:${menuList}" class="display:inline-de">
        <li><a th:href="@{${item.path}}" th:text="${item.name}"></a></li>
    </div>
    <a th:href="@{/login}" style="float:right;font-size: 16px;margin: 17px;color: white;">> 登出</a>
</ul>
<div class="form-container border s" style="text-align: center;background: white;">
    <h2 class="form-title" style="font-family: 幼圆;font-weight: bold" >创建货运单</h2>
    <form class="layui-form">
        <blockquote class="layui-elem-quote" style="border-left-width: 0px;background: white!important;">
                <div class="layui-form-item">
                    <label class="layui-form-label">发车点</label>
                    <div class="layui-input-inline">
                        <input type="text" name="start" placeholder="请输入发车点" lay-verify="required" autocomplete="off" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">目的地</label>
                    <div class="layui-input-inline">
                        <input type="text" name="target" placeholder="请输入目的地" lay-verify="required" autocomplete="off" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">收货人</label>
                    <div class="layui-input-inline">
                        <input type="text" name="consignee"  placeholder="请输入收货人" lay-verify="required" autocomplete="off" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">距离</label>
                    <div class="layui-input-inline">
                        <input type="text" name="distance" placeholder="请输入总距离（km）" lay-verify="required|number" autocomplete="off" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item layui-form-text">
                    <label class="layui-form-label">货物内容</label>
                    <div class="layui-input-block">
                        <textarea name="goods" lay-verify="required" placeholder="请输入货物内容(货物名+重量t）" class="layui-textarea"></textarea>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">货物总重</label>
                    <div class="layui-input-block">
                        <input type="text" name="weight" placeholder="请输入货物总重(t）" autocomplete="off" lay-verify="required|number" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item layui-form-text">
                    <label class="layui-form-label">备注</label>
                    <div class="layui-input-block">
                        <textarea name="desc" placeholder="" class="layui-textarea"></textarea>
                    </div>
                </div>
                <div class="layui-form-item">
                    <div class="layui-input-block">
                        <button th:name="${userId}" class="layui-btn" lay-submit lay-filter="formDemo">立即提交</button>
                        <button type="reset" class="layui-btn layui-btn-primary">重置</button>
                    </div>
                </div>
        </blockquote>
    </form>
</div>
<table class="layui-table" id="dataTable"></table>
<script>
    //Demo
    layui.use('form', function(){
        var form = layui.form;
        //监听提交
        form.on('submit(formDemo)', function(data){
            console.log(data)
            data.field.creatorId=data.elem.name;
            $.ajax({
                type: "post",
                url: "/account/createShippingOrder",
                data: data.field,
                complete:function(){
                    layer.msg("创建货运单成功");
                    location.reload();
                }
            });
            return false;
        });
    });
</script>
<script type="text/html" id="operationTemplet">
    <a class='layui-btn layui-btn-xs edit' data-id='{{d.id}}'>修改</a>
</script>
</body>
</html>
